//
//  ZBMoBanSixSmallView.m
//  MoBan
//
//  Created by apple on 16/7/13.
//  Copyright © 2016年 apple. All rights reserved.
//

#import "ZBMoBanSixSmallView.h"
#define lablefont 14*Kscr
@interface ZBMoBanSixSmallView()
@property(nonatomic,strong)UIImageView *imageview;
@property(nonatomic,strong)UILabel *lable;
@end
@implementation ZBMoBanSixSmallView
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self addUI];
    }
    return self;
}
-(void)addUI
{
    self.imageview = [[UIImageView alloc]init];
    self.imageview.image = [UIImage imageNamed:@"text.png"];
    [self addSubview:self.imageview];
    
    self.lable = [[UILabel alloc]init];
    self.lable.textColor= [UIColor blackColor];
    self.lable.font = [UIFont systemFontOfSize:lablefont];
    [self addSubview:self.lable];
}
-(void)ZBGaveSmallViewMessage:(NSString *)str Withtag:(NSInteger)inter;
{
    [self ZBSetMessage:str];
    
    [self ZBSetFram:str With:inter];
}
/**
 设置文字
 */
-(void)ZBSetMessage:(NSString *)str
{
    self.lable.text = str;
}
/**
 设置frma
 */
-(void)ZBSetFram:(NSString *)str With:(NSInteger )inter
{
    self.imageview.frame = CGRectMake(5*Kscr, 5*Kscr, 10*Kscr, 10*Kscr);
    
    CGSize size = [Unit getSizeWithStrNo:str hight:20*Kscr font:lablefont ];
    
    self.lable.frame = CGRectMake(self.imageview.right+5*Kscr, 0, size.width, 20*Kscr);
    
    [self.deleget ZBGetSmallViewWidth:self.lable.right+5*Kscr Withtag:inter];

}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
